<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>文件上传</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="description" content="文件上传">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/sm/pages/css/style.css">
<script type='text/javascript' src='/sm/dwr/interface/managerAjax.js'></script>
<script type='text/javascript' src='/sm/dwr/engine.js'></script>
<script type='text/javascript' src='/sm/pages/js/validator.js'></script>
  <script type='text/javascript'>
      function submitForm(form){
          if(isNull(form.uploadExcel.value)){
              alert("请选择excel文件！");
              return false;
          }else{
              var fileSuffix = form.uploadExcel.value.split(".");
              if(fileSuffix[fileSuffix.length-1]!= "xls"){
                  alert("文件类型有误，请选择excel文件！");
                  return false;
              }
              form.submit();
              
          }
      }
  </script>
</head>
<body>
<form id="uploadForm" name="uploadForm" action="/sm/controller/itemManager/upload" method="POST" enctype="multipart/form-data">
    <table>
    <tr><td>文件上传</td></tr>
        <tr>
            <td>
                                           上传excel文件：</td>
            <td>
                <input type="file" name="uploadExcel"/>
            </td>
            </tr>

            </tr>

        <tr><td>&nbsp;</td><td><input type="button" value="提交" onclick="submitForm(this.form);"/></td></tr>
    </table>
</form>
</body>
</html>